﻿using GeneralServices.ViewModel;
using System.Windows.Input;


namespace MessageBox
{
    public class BoxMessageViewModel
    {
        #region Attribut(s)


        #endregion

        #region Propriété(s)

        public ICommand OK
        {
            get;
            private set;
        }

        public ICommand KO
        {
            get;
            private set;
        }

        #endregion

        #region Constructeur(s)

        public BoxMessageViewModel()
        {
            /*** INIT COMMAND ***/
            OK = new RelayCommand(ActionOK);
            KO = new RelayCommand(ActionKO);
        }

        #endregion

        #region Méthode(s)

        private void ActionOK(object obj)
        {
            if (obj != null && obj is BoxMessage)
            {
                BoxMessage view = ((BoxMessage)obj);
                view.Confirm = true;
                view.Close();
            }
        }

        private void ActionKO(object obj)
        {
            if (obj != null && obj is BoxMessage)
            {
                BoxMessage view = ((BoxMessage)obj);
                view.Confirm = false;
                view.Close();
            }
        }

        #endregion
    }
}
